# @Author：silence
# @Email：792245022@qq.com
# @Date：2025/1/9 1:20
import random

count = 0

while True:
    num = random.randint(1, 100)
    print(f"num = {num}")
    count += 1
    if num == 97:
        break
print(f"生成到 97 用了：{count} 次")

"""
如果一个 for 循环被 break 所终结，该循环的控制变量会保持其当前值
"""

for i in range(1, 7):
    if i > 3:
        break
print(f"i = {i}")